#include "dialog.h"

#include <QLabel>
#include <QDebug>
#include <QPushButton>
#include <QVBoxLayout>

Dialog::Dialog(QWidget* parent):QDialog(parent)
{
    QLabel* label = new QLabel("对话框标签", this);
    QPushButton* button = new QPushButton("关闭", this);

    // 创建一个垂直布局
    QVBoxLayout* layout = new QVBoxLayout;
    this->setLayout(layout);


    layout->addWidget(label);
    layout->addWidget(button);

    connect(button, &QPushButton::clicked, this, [this](){
        this->close();
    });

}
